//-----------------------------------------------------------------------
// <copyright file="IEventBroker.cs" company="iron9light">
//      Copyright (c) iron9light. All rights reserved.
// </copyright>
// <author>iron9light</author>
//-----------------------------------------------------------------------

namespace EventBroker
{
    using System;
    using System.Collections.Generic;

    /// <summary>
    /// The event broker.
    /// </summary>
    public interface IEventBroker : IDisposable
    {
        /// <summary>
        /// Gets the registered events.
        /// </summary>
        /// <value>The registered events.</value>
        IEnumerable<string> RegisteredEvents
        {
            get;
        }

        /// <summary>
        /// Registers the publication.
        /// </summary>
        /// <param name="eventTopicName">Name of the published event.</param>
        /// <param name="publisher">The publisher.</param>
        /// <param name="eventName">Name of the event.</param>
        void RegisterPublication(string eventTopicName, object publisher, string eventName);

        /// <summary>
        /// Unregisters the publication.
        /// </summary>
        /// <param name="eventTopicName">Name of the published event.</param>
        /// <param name="publisher">The publisher.</param>
        /// <param name="eventName">Name of the event.</param>
        void UnregisterPublication(string eventTopicName, object publisher, string eventName);

        /// <summary>
        /// Unregisters the publisher.
        /// </summary>
        /// <param name="publisher">The publisher.</param>
        void UnregisterPublisher(object publisher);

        /// <summary>
        /// Registers the subscription.
        /// </summary>
        /// <param name="eventTopicName">Name of the event topic.</param>
        /// <param name="subscriber">The subscriber.</param>
        /// <param name="methodName">Name of the method.</param>
        void RegisterSubscription(string eventTopicName, object subscriber, string methodName);

        /// <summary>
        /// Registers the subscription.
        /// </summary>
        /// <param name="eventTopicName">Name of the event topic.</param>
        /// <param name="subscriber">The subscriber.</param>
        /// <param name="methodName">Name of the method.</param>
        /// <param name="parameterTypes">The parameter types.</param>
        void RegisterSubscription(string eventTopicName, object subscriber, string methodName, Type[] parameterTypes);

        /// <summary>
        /// Unregisters the subscription.
        /// </summary>
        /// <param name="eventTopicName">Name of the event topic.</param>
        /// <param name="subscriber">The subscriber.</param>
        /// <param name="methodName">Name of the method.</param>
        void UnregisterSubscription(string eventTopicName, object subscriber, string methodName);

        /// <summary>
        /// Unregisters the subscriber.
        /// </summary>
        /// <param name="subscriber">The subscriber.</param>
        void UnregisterSubscriber(object subscriber);
    }
}